package model

import (
	"time"
)

const (
	StatusOnWork  = "ON_WORK"
	StatusOffWork = "OFF_WORK"
)

type UserModel struct {
	Id             int64     `json:"id" xorm:"pk autoincr comment('auto_increment') BIGINT(20)"`
	PaUserId       int64     `json:"pa_user_id" xorm:"not null default 0 comment('主账号ID') BIGINT(20)"`
	MerchantId     int64     `json:"merchant_id" xorm:"not null default 0 comment('门店ID') BIGINT(20)"`
	UserName       string    `json:"user_name" xorm:"not null default '' comment('用户名') VARCHAR(40)"`
	Password       string    `json:"password" xorm:"not null default '' comment('密码') VARCHAR(40)"`
	PhoneNumber    string    `json:"phone_number" xorm:"not null default '' comment('联系方式') VARCHAR(20)"`
	RealName       string    `json:"real_name" xorm:"not null default '' comment('真实姓名') VARCHAR(30)"`
	Status         string    `json:"status" xorm:"not null default '' comment('上下班状态') ENUM"`
	CreateTime     time.Time `json:"create_time" xorm:"not null default '1980-01-01 00:00:00' comment('创建时间') TIMESTAMP"`
	LastUpdateTime time.Time `json:"last_update_time" xorm:"not null default 'CURRENT_TIMESTAMP' comment('最后更新时间') TIMESTAMP"`
}

func (*UserModel) TableName() string {
	return "user"
}
